{\rtf1\ansi\ansicpg936\deff0\deflang1033\deflangfe2052{\fonttbl{\f0\fmodern\fprq6\fcharset134 \'cb\'ce\'cc\'e5;}{\f1\fnil\fcharset134 \'cb\'ce\'cc\'e5;}}
{\colortbl ;\red255\green0\blue0;\red0\green255\blue0;}
{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\lang2052\f0\fs20 ================================\par
= \'c3\'b6\'be\'d9\'d1\'a7\'cf\'b0\par
================================\par
1.\'c3\'b6\'be\'d9(Enum):\'ce\'d2\'c3\'c7\'cb\'f9\'b6\'a8\'d2\'e5\'b5\'c4\'c3\'bf\'b8\'f6\'c3\'b6\'be\'d9\'c0\'e0\'d0\'cd\'b6\'bc\'bc\'cc\'b3\'d0\'d7\'d4java.lang.Enum\'c0\'e0\'a3\'ac\'c3\'b6\'be\'d9\'d6\'d0\'b5\'c4\'c3\'bf\'b8\'f6\'b3\'c9\'d4\'b1\'c4\'ac\'c8\'cf\'b6\'bc\'ca\'c7public static final\'b5\'c4\'a1\'a3\par
\par
2.\cf1\b\'c3\'bf\'b8\'f6\'c3\'b6\'be\'d9\'b5\'c4\'b3\'c9\'d4\'b1\'c6\'e4\'ca\'b5\'be\'cd\'ca\'c7\'c4\'fa\'b6\'a8\'d2\'e5\'b5\'c4\'c3\'b6\'be\'d9\'c0\'e0\'d0\'cd\'b5\'c4\'d2\'bb\'b8\'f6\'ca\'b5\'c0\'fd(Instance)\cf0\b0 .\'bb\'bb\'be\'e4\'bb\'b0\'cb\'b5\'a3\'ac\'b5\'b1\'b6\'a8\'d2\'e5\'c1\'cb\'d2\'bb\'b8\'f6\'c3\'b6\'be\'d9\'c0\'e0\'d0\'cd\'ba\'f3\'a3\'ac\'d4\'da\'b1\'e0\'d2\'eb\'ca\'b1\'be\'cd\'c4\'dc\'c8\'b7\'b6\'a8\par
  \'b8\'c3\'c3\'b6\'be\'d9\'c0\'e0\'d0\'cd\'d3\'d0\'bc\'b8\'b8\'f6\'ca\'b5\'c0\'fd\'a1\'a2\'b7\'d6\'b1\'f0\'ca\'c7\'ca\'b2\'c3\'b4\'a1\'a3\'d4\'da\'d4\'cb\'d0\'d0\'c6\'da\'bc\'e4\'ce\'d2\'c3\'c7\'ce\'de\'b7\'a8\'d4\'d9\'ca\'b9\'d3\'c3\'b8\'c3\'c3\'b6\'be\'d9\'c0\'e0\'d0\'cd\'b4\'b4\'bd\'a8\'d0\'c2\'b5\'c4\'ca\'b5\'c0\'fd\'c1\'cb\'a3\'ac\'d5\'e2\'d0\'a9\'ca\'b5\'c0\'fd\'d4\'da\'b1\'e0\'d2\'eb\'c6\'da\'bc\'e4\'be\'cd\'d2\'d1\'be\'ad\'cd\'ea\'c8\'ab\'c8\'b7\'b6\'a8\par
  \'cf\'c2\'c0\'b4\'c1\'cb\'a1\'a3\f1\par
\par
===========================\par
= java\'b7\'b4\'c9\'e4\'bb\'fa\'d6\'c6\'d1\'a7\'cf\'b0\par
===========================\par
\'d2\'bb:\'b7\'b4\'c9\'e4\'bb\'fa\'d6\'c6\par
\tab Reflection(\'b7\'b4\'c9\'e4)\'ca\'c7java\'b1\'bb\'ca\'d3\'ce\'aa\'b6\'af\'cc\'ac(\'bb\'f2\'d7\'bc\'b6\'af\'cc\'ac)\'d3\'ef\'d1\'d4\'b5\'c4\'d2\'bb\'b8\'f6\'b9\'d8\'bc\'fc\'d0\'d4\'d6\'ca(\'be\'a1\'b9\'dc\'b0\'b4\'d1\'cf\'b8\'f1\'b6\'a8\'d2\'e5\'c0\'b4\'cb\'b5java\'b2\'bb\'cb\'e3\'b6\'af\'cc\'ac\'d3\'ef\'d1\'d4)\'a1\'a3\par
\tab\'d5\'e2\'b8\'f6\'bb\'fa\'d6\'c6\'d4\'ca\'d0\'ed\'b3\'cc\'d0\'f2\'d4\'da\'d4\'cb\'d0\'d0\'ca\'b1\'cd\'b8\'b9\'fdReflection API\'c8\'a1\'b5\'c3\'c8\'ce\'ba\'ce\'d2\'bb\'b8\'f6\cf1\b\'d2\'d1\'d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'd0\'b6\'cf\'c8\'ce\'d2\'e2\'d2\'bb\'b8\'f6\'c0\'e0\'cb\'f9\'be\'df\'d3\'d0\'b5\'c4\'b3\'c9\'d4\'b1\'b1\'e4\'c1\'bf\'ba\'cd\'b7\'bd\'b7\'a8\par
\tab\'d7\'a2:java\'d6\'d0\'a3\'ac\'b6\'d4\'d3\'da\'cd\'ac\'d2\'bb\'b8\'f6\'c0\'e0\'ce\'de\'c2\'db\'b2\'fa\'c9\'fa\'b6\'e0\'c9\'d9\'b8\'f6\'b6\'d4\'cf\'f3\'a3\'ac\'d5\'e2\'d0\'a9\'b6\'d4\'cf\'f3\'b6\'bc\'b6\'d4\'d3\'a6\'cd\'ac\'d2\'bb\'b8\'f6Class\'b6\'d4\'cf\'f3\par
\par
\'c8\'fd:\'ca\'b9\'d3\'c3\'b7\'b4\'c9\'e4\par
\tab 1.\'d2\'aa\'cf\'eb\'ca\'b9\'d3\'c3\'b7\'b4\'c9\'e4\'ca\'d7\'cf\'c8\'d2\'aa\'b5\'c3\'b5\'bd\'b4\'fd\'b4\'a6\'c0\'ed\'c0\'e0\'bb\'f2\'b6\'d4\'cf\'f3\'cb\'f9\'b6\'d4\'d3\'a6\'b5\'c4Class\'b6\'d4\'cf\'f3(3\'d6\'d6\'b7\'bd\'ca\'bd\'bb\'f1\'b5\'c3)\par
\tab\tab\cf1 i).\'ca\'b9\'d3\'c3Class\'c0\'e0\'b5\'c4\'be\'b2\'cc\'ac\'b7\'bd\'b7\'a8 forName() \cf0 -- Class.forName("java.lang.String"); \par
\cf1\tab\tab ii).\'ca\'b9\'d3\'c3\'c0\'e0\'b5\'c4 .class \'d3\'ef\'b7\'a8 \cf0 -- String.class;\par
\cf1\tab\tab iii).\'ca\'b9\'d3\'c3\'b6\'d4\'cf\'f3\'b5\'c4getClass()\'b7\'bd\'b7\'a8\par
\tab\tab\tab\cf0 String s = "demo"; Class<?> clazz = s.getClass();\par
\par
\tab 2.\'b7\'b4\'c9\'e4\'d6\'d0\'c8\'f4\'cf\'eb\'cd\'a8\'b9\'fd\'c0\'e0\'b5\'c4\'b2\'bb\'b4\'f8\'b2\'ce\'ca\'fd\'b5\'c4\'b9\'b9\'d4\'ec\'b7\'bd\'b7\'a8\'c0\'b4\'c9\'fa\'b3\'c9\'b6\'d4\'cf\'f3\'a3\'ac\'d3\'d02\'d6\'d6\'b7\'bd\'b7\'a8\par
\tab\tab\cf1 i).\'cf\'c8\'b5\'c3\'b5\'bdClass\'b6\'d4\'cf\'f3\'a3\'ac\'c8\'bb\'ba\'f3\'cd\'a8\'b9\'fdClass\'b6\'d4\'cf\'f3\'b5\'c4newInstance()\'b7\'bd\'b7\'a8\'d6\'b1\'bd\'d3\'c9\'fa\'b3\'c9\par
\cf0\tab\tab\tab Class<?> clazz = String.class; Object obj = clazz.newInstance();\par
\tab\tab\cf1 ii).\'cf\'c8\'bb\'f1\'b5\'c3Class\'b6\'d4\'cf\'f3\'a3\'ac\'c8\'bb\'ba\'f3\'cd\'a8\'b9\'fd\'b8\'c3\'b6\'d4\'cf\'f3\'bb\'f1\'b5\'c3\'b6\'d4\'d3\'a6\'b5\'c4 Constructor \'b6\'d4\'cf\'f3\'a3\'ac\'d4\'d9\'cd\'a8\'b9\'fd\'b8\'c3Constructor\'b6\'d4\'cf\'f3\'b5\'c4\par
\tab\tab   newInstance()\'b7\'bd\'b7\'a8\'c9\'fa\'b3\'c9\'b6\'d4\'cf\'f3\par
\cf0\tab\tab\tab Class<?> clazz = Cunstomer.class;  //Customer\'ca\'c7\'d2\'bb\'b8\'f6\'d7\'d4\'b6\'a8\'d2\'e5\'b5\'c4\'c0\'e0\par
\tab\tab\tab Constructor cons = clazz.getConstructor(new Class[]\{\});\par
\tab\tab\tab cons.newInstance(new Object[]\{\});\par
\tab     \par
\tab     \par
\par
\'cb\'c4:\'b7\'b4\'c9\'e4\'d3\'d0\'b9\'d8\'b5\'c4JDK\par
\tab\'d3\'eb\'b7\'b4\'c9\'e4\'d3\'d0\'b9\'d8\'b5\'c4\'c0\'e0\'b6\'bc\'ce\'bb\'d3\'da\cf1\b java.lang.reflect\cf0\b0\'b0\'fc\'d6\'d0\par
\tab - Class\'c0\'e0: \'b4\'fa\'b1\'ed\'d2\'bb\'b8\'f6\'c0\'e0\par
\tab - Field\'c0\'e0: \'b4\'fa\'b1\'ed\'c0\'e0\'b5\'c4\'b3\'c9\'d4\'b1\'b1\'e4\'c1\'bf(\'b3\'c9\'d4\'b1\'b1\'e4\'c1\'bf\'d2\'b2\'b3\'c6\'ce\'aa\'c0\'e0\'b5\'c4\'ca\'f4\'d0\'d4)\par
\tab - Method\'c0\'e0: \'b4\'fa\'b1\'ed\'c0\'e0\'b5\'c4\'b7\'bd\'b7\'a8\par
\tab - Constructor\'c0\'e0: \'b4\'fa\'b1\'ed\'c0\'e0\'b5\'c4\'b9\'b9\'d4\'ec\'b7\'bd\'b7\'a8\par
\tab - Array\'c0\'e0: \'cc\'e1\'b9\'a9\'c1\'cb\'b6\'af\'cc\'ac\'b4\'b4\'bd\'a8\'ca\'fd\'d7\'e9\'a3\'ac\'d2\'d4\'bc\'b0\'b7\'c3\'ce\'ca\'ca\'fd\'d7\'e9\'b5\'c4\'d4\'aa\'cb\'d8\'b5\'c4\'be\'b2\'cc\'ac\'b7\'bd\'b7\'a8\par
\par
\par
\par
=====================================\par
= \'c0\'fd\'d7\'d3\'d1\'dd\'ca\'be1\par
=====================================\par
\tab public clsaa \'b7\'b4\'c9\'e4\'d1\'dd\'ca\'be \{\par
\tab\tab public int sum(int a, int b) \{\par
\tab\tab\tab return a + b;\par
\tab\tab\}\par
\tab\tab public String echo(String name) \{\par
\tab\tab\tab return "hello" + name;\par
\tab\tab\}\par
\tab\tab\par
\tab\tab public static void main(String[] args) \{\par
\tab\tab\tab // 1.\'b5\'c3\'b5\'bdClass\'b6\'d4\'cf\'f3\par
\tab\tab\tab Class<?> clazz = \'b7\'b4\'c9\'e4\'d1\'dd\'ca\'be.clsaa;\par
\tab\tab\tab // 2.\'b5\'c3\'b5\'bd\'b6\'a8\'d2\'e5\'b5\'c4\'b7\'bd\'b7\'a8\par
\tab\tab\tab Method sumMethod = clazz.getMethod("sum", new Class[]\{int.class, int.class\});\par
\tab\tab\tab method echoMethod = clazz.getMethod("echo", new Class[]\{String.clsaa\});\par
\tab\tab\tab // 3.\'b4\'b4\'bd\'a8\'b8\'c3\'c0\'e0\'b5\'c4\'b6\'d4\'cf\'f3\par
\tab\tab\tab Object reflectObj = clazz.newInstance();\par
\tab\tab\tab\par
\tab\tab\tab // 4.\'d6\'b4\'d0\'d0\'c0\'e0\'d6\'d0\'b6\'a8\'d2\'e5\'b5\'c4\'b7\'bd\'b7\'a8\par
\tab\tab\tab Object rs1 = sumMethod.invoke(reflectObj, new Object[]\{1, 2\});\par
\tab\tab\tab Object rs2 = echoMethod.invoke(reflectObj, new Object[]\{"tom"\});\par
\tab\tab\}\par
\tab\}\par
\par
=====================================\par
= \'c0\'fd\'d7\'d3\'d1\'dd\'ca\'be2\par
=====================================\par
public class ReflectCopy() \{\par
\tab //\'b7\'bd\'b7\'a8\'ca\'b5\'cf\'d6\'b0\'d1\'b4\'ab\'bd\'f8\'c0\'b4\'b5\'c4\'b6\'d4\'cf\'f3\'bf\'bd\'b1\'b4\'b3\'c9returnObj\'b7\'b5\'bb\'d8\par
\tab //\'b8\'c3\'bf\'bd\'b1\'b4\'b2\'bb\'ca\'c7\'bc\'f2\'b5\'a5\'b5\'c4new\'b3\'f6\'b6\'d4\'cf\'f3\'a3\'ac\'bb\'b9\'d2\'aa\'b0\'d1\'d4\'ad\'c0\'b4\'b6\'d4\'cf\'f3\'d6\'d0\'b5\'c4\'ca\'fd\'be\'dd\'bf\'bd\'b1\'b4\'b3\'f6\'c0\'b4\par
\tab public Object copy(Object object) \{\par
\tab\tab Object returnObj;\par
\tab\tab Class<?> clazz = object.getClass();\par
\tab\tab returnObj = clazz.getConstructor(new Class[]\{\}).newInstance(new Object[]\{\});\par
\tab\tab //\'b5\'c3\'b5\'bd\'c9\'f9\'c3\'f7\'b5\'c4\'b3\'c9\'d4\'b1\'b1\'e4\'c1\'bf\par
\tab\tab Field[] fields = clazz.getDeclaredFields();\par
\tab\tab for(Field field : fields) \{\par
\tab\tab\tab  //\'b5\'c3\'b5\'bd\'b3\'c9\'d4\'b1\'b1\'e4\'c1\'bf\'b5\'c4\'c3\'fb\'d7\'d6\par
\tab\tab\tab String name = field.getName();\par
\tab\tab\tab String firstLetter = name.subString(0,1).toUpperCase();\par
\tab\tab\tab //\'b5\'c3\'b5\'bdCustomer\'c0\'e0\'b5\'c4get\'ba\'cdset\'b7\'bd\'b7\'a8\'c3\'fb\par
\tab\tab\tab String getMethodName = "get" + firstLetter + name.subString(1);\par
\tab\tab\tab String setMethodName = "set" + firstLetter + name.subString(1);\par
\tab\tab\tab //\'cd\'a8\'b9\'fd\'b7\'b4\'c9\'e4\'b5\'c3\'b5\'bdCustomer\'c0\'e0\'b6\'a8\'d2\'e5\'b5\'c4get\'ba\'cdset\'b7\'bd\'b7\'a8\par
\tab\tab\tab Method getMethod = clazz.getMethod(getMethodName, new Class[]\{\});\par
\tab\tab\tab Method setMethod = clszz.getMethod(setMethodName, new Class[]\{field.getType()\}); //\'b5\'c3\'b5\'bd\'ca\'f4\'d0\'d4\'b5\'c4\'c0\'e0\'d0\'cd\par
\tab\tab\tab //\'b0\'d1\'d4\'ad\'c0\'b4\'b6\'d4\'cf\'f3\'b5\'c4\'ca\'fd\'be\'dd\'bf\'bd\'b1\'b4\'b5\'bdreturnObj\'d6\'d0\par
\tab\tab\tab Object value = getMethod.invoke(object, new Object[]\{\}); //\'c8\'a1\'b3\'f6\'d4\'ad\'c0\'b4\'ca\'f4\'d0\'d4\'b5\'c4\'d6\'b5\par
\tab\tab\tab setMethod.invoke(returnObj, new Object[]\{value\}); //\'b0\'d1\'d6\'b5\'c9\'e8\'d6\'c3\'b5\'bdreturnObj\'d6\'d0\par
\tab\tab\}\par
\tab\tab return returnObj;\par
\tab\}\par
\}\par
\par
\par
class Customer \{\par
\tab private String name;\par
\tab private int age;\par
\tab public Customer()\{\}\par
\tab public void setName(String name) \{\par
\tab\tab this.name = name;\par
\tab\}\par
\tab public String getName() \{\par
\tab\tab return this.name;\par
\tab\}\par
\par
\tab public void setAge(int age) \{\par
\tab\tab this.age = age;\par
\tab\}\par
\tab public int getAge() \{\par
\tab\tab return this.age;\par
\tab\}\par
\}\par
\par
=====================================\par
= \'c0\'fd\'d7\'d3\'d1\'dd\'ca\'be3  \'b7\'b4\'c9\'e4\'b7\'c3\'ce\'ca\'cb\'bd\'d3\'d0\'b3\'c9\'d4\'b1\par
=====================================\par
class PrivateDemo \{\par
\tab private String name = "zhangsan";\par
\tab public String getName() \{\par
\tab\tab return name;\par
\tab\}\par
\}\par
\par
public class TestPrivate() \{\par
\tab public static void main(String[] args) \{\par
\tab\tab PrivateDemo p = new PrivateDemo();\par
\tab\tab Class<?> clazz = p.class;\par
\tab\tab Field f = clazz.getDeclaredField("name");\par
\tab\tab f.setAccessible(true); //\'d2\'f2\'ce\'aaname\'ca\'c7\'cb\'bd\'d3\'d0\'b5\'c4,\'d2\'aa\'b0\'d1\'cb\'fc\'c9\'e8\'d6\'c3\'ce\'aa\'bf\'c9\'b7\'c3\'ce\'ca\'b5\'c4\'b2\'c5\'d0\'d0\par
\tab\tab f.set(p, "lisi");\par
\tab\tab System.out.println(p.getName);\par
\tab\}\par
\}\par
\par
\par
=====================================\par
= \'b4\'fa\'c0\'ed\'d1\'a7\'cf\'b0\par
=====================================\par
1.\'b4\'fa\'c0\'ed\'c4\'a3\'ca\'bd\'d2\'bb\'b0\'e3\'c9\'e6\'bc\'b0\'b5\'bd\'b5\'c4\'bd\'c7\'c9\'ab\par
\tab - \'b3\'e9\'cf\'f3\'bd\'c7\'c9\'ab: \'c9\'f9\'c3\'f7\'d5\'e6\'ca\'b5\'b6\'d4\'cf\'f3\'ba\'cd\'b4\'fa\'c0\'ed\'b6\'d4\'cf\'f3\'b5\'c4\cf2\'b9\'b2\'c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ac\'ca\'c7\'ce\'d2\'c3\'c7\'d7\'ee\'d6\'d5\'d2\'aa\'d2\'fd\'d3\'c3\'b5\'c4\'b6\'d4\'cf\'f3\par
\par
2.\'be\'b2\'cc\'ac\'b4\'fa\'c0\'ed ============================\par
//\'cc\'e1\'b3\'f6\'b9\'b2\'cd\'ac\'bd\'d3\'bf\'da\'b5\'c4\'c0\'e0\par
interface Clazz \{\par
\tab void process();\par
\}\par
//\'d5\'e6\'ca\'b5\'b6\'d4\'cf\'f3\'c0\'e0\par
class RealClazz implements Clazz \{\par
\tab public void process() \{\par
\tab\tab System.out.println("from real class");\par
\tab\}\par
\}\par
//\'b4\'fa\'c0\'ed\'c0\'e0\par
class ProxyClazz implements Clazz \{\par
\tab private RealClazz realClazz;  //\'b4\'fa\'c0\'ed\'b6\'d4\'cf\'f3\'c4\'da\'b1\'a3\'b4\'e6\'c1\'cb\'d5\'e6\'ca\'b5\'b6\'d4\'cf\'f3\'b5\'c4\'d2\'fd\'d3\'c3\par
\tab public void process() \{\par
\tab\tab //\'d4\'da\'b4\'cb\'bf\'c9\'d2\'d4\'d4\'da\'b5\'f7\'d3\'c3\'d5\'e6\'ca\'b5\'b6\'d4\'cf\'f3\'b7\'bd\'b7\'a8\'c7\'b0\'cc\'ed\'bc\'d3\'d7\'d4\'bc\'ba\'d2\'aa\'cf\'c8\'b5\'f7\'d3\'c3\'b5\'c4\'b7\'bd\'b7\'a8\par
\tab\tab if (null == realClazz) \{\par
\tab\tab\tab realClazz = new RealClazz();\par
\tab\tab\}\par
\tab\tab //\'b5\'f7\'d3\'c3\'d5\'e6\'ca\'b5\'b6\'d4\'cf\'f3\'b5\'c4process\'b7\'bd\'b7\'a8\par
\tab\tab realClazz.process();\par
\tab\tab //\'d4\'da\'b4\'cb\'bf\'c9\'d2\'d4\'d4\'da\'b5\'f7\'d3\'c3\'d5\'e6\'ca\'b5\'b6\'d4\'cf\'f3\'b7\'bd\'b7\'a8\'ba\'f3\'cc\'ed\'bc\'d3\'d7\'d4\'bc\'ba\'d2\'aa\'b5\'f7\'d3\'c3\'b5\'c4\'b7\'bd\'b7\'a8\par
\par
\tab\}\par
\}\par
//\'b5\'f7\'d3\'c3\'c0\'e0\par
public class Client \{\par
\tab public static void main(String[] args) \{\par
\tab\tab Clazz c = new ProxyClazz();\par
\tab\tab c.process();\par
\tab\}\par
\}\par
\par
3.\'b6\'af\'cc\'ac\'b4\'fa\'c0\'ed ==============================\par
\tab\'b2\'bd\'d6\'e8:\par
\tab i) \'b4\'b4\'bd\'a8\'d2\'bb\'b8\'f6\'ca\'b5\'cf\'d6InvocationHandler\'bd\'d3\'bf\'da\'b5\'c4\'c0\'e0\'a3\'ac\'b2\'a2\'ca\'b5\'cf\'d6\'c6\'e4\'b7\'bd\'b7\'a8invoke()\par
\tab ii) \'b4\'b4\'bd\'a8\'b1\'bb\'b4\'fa\'c0\'ed\'b5\'c4\'c0\'e0\'a3\'ac\'bc\'b0\'b3\'e9\'b3\'f6\'bd\'d3\'bf\'da\par
\tab iii) \'cd\'a8\'b9\'fdProxy\'b5\'c4\'be\'b2\'cc\'ac\'b7\'bd\'b7\'a8 newProxyInstance(ClassLoader loader, Class[]interfaces,\par
\tab\tab InvocationHandler h) \'b4\'b4\'bd\'a8\'d2\'bb\'b8\'f6\'b4\'fa\'c0\'ed\par
\tab vi) \'cd\'a8\'b9\'fd\'b4\'fa\'c0\'ed\'b5\'f7\'d3\'c3\'b7\'bd\'b7\'a8\par
\par
\par
//\'cc\'e1\'b3\'f6\'b9\'b2\'cd\'ac\'bd\'d3\'bf\'da\'b5\'c4\'c0\'e0\par
public interface Clazz \{\par
\tab public void process();\par
\}\par
//\'d5\'e6\'ca\'b5\'b6\'d4\'cf\'f3\'c0\'e0\par
public class RealClazz implements Clazz \{\par
\tab public void process() \{\par
\tab\tab System.out.println("from real class");\tab\par
\tab\}\par
\}\par
//\'b4\'fa\'c0\'ed\'c0\'e0\par
public class ProxyClazz implements InvocationHandler \{\par
\tab private Object object; //\'b4\'fa\'c0\'ed\'c0\'e0\'d6\'d0\'b1\'a3\'b4\'e6\'b5\'c4\'d5\'e6\'ca\'b5\'c0\'e0\'b5\'c4\'d2\'fd\'d3\'c3(\'b4\'fa\'c0\'ed\'c0\'e0\'bf\'c9\'d2\'d4\'b4\'fa\'c0\'ed\'c8\'ce\'d2\'e2\'c0\'e0)\par
\tab public ProxyClazz()\{\}\par
\tab public ProxyClazz(Object obj) \{\par
\tab\tab this.object = obj;\par
\tab\}\par
\tab /**\par
\tab  * @param proxy  \par
\tab  * @param method \'bf\'cd\'bb\'a7\'b5\'f7\'d3\'c3\'b5\'c4\'d5\'e6\'ca\'b5\'c0\'e0\'d6\'d0\'b5\'c4\'b7\'bd\'b7\'a8\'a3\'ac\'d5\'e2\'b8\'f6\'b2\'ce\'ca\'fd\'d3\'c9InvocationHandler\'c0\'e0\'b9\'dc\'c0\'ed\'b4\'ab\'b5\'dd\'b5\'bd\'d5\'e2\'c0\'ef\par
\tab  * @param args \'bf\'cd\'bb\'a7\'b5\'f7\'d3\'c3\'b7\'bd\'b7\'a8\'ca\'b1\'b4\'ab\'c8\'eb\'b5\'c4\'b2\'ce\'ca\'fd\'a3\'ac\'d5\'e2\'b8\'f6\'b2\'ce\'ca\'fd\'d3\'c9InvocationHandler\'c0\'e0\'b9\'dc\'c0\'ed\'b4\'ab\'b5\'dd\'b5\'bd\'d5\'e2\'c0\'ef\par
\tab  */\par
\tab public Object invoke(Object proxy, Method method, Object[] args) throws Throwable \{\par
\tab\tab //\'d4\'da\'b4\'cb\'bf\'c9\'d2\'d4\'d4\'da\'b5\'f7\'d3\'c3\'d5\'e6\'ca\'b5\'b6\'d4\'cf\'f3\'b7\'bd\'b7\'a8\'c7\'b0\'cc\'ed\'bc\'d3\'d7\'d4\'bc\'ba\'d2\'aa\'cf\'c8\'b5\'f7\'d3\'c3\'b5\'c4\'b7\'bd\'b7\'a8\par
\par
\tab\tab //\'b5\'f7\'d3\'c3\'d5\'e6\'ca\'b5\'b6\'d4\'cf\'f3\'b5\'c4process\'b7\'bd\'b7\'a8\par
\tab\tab method.invoke(object,args);\par
\par
\tab\tab //\'d4\'da\'b4\'cb\'bf\'c9\'d2\'d4\'d4\'da\'b5\'f7\'d3\'c3\'d5\'e6\'ca\'b5\'b6\'d4\'cf\'f3\'b7\'bd\'b7\'a8\'ba\'f3\'cc\'ed\'bc\'d3\'d7\'d4\'bc\'ba\'d2\'aa\'b5\'f7\'d3\'c3\'b5\'c4\'b7\'bd\'b7\'a8\par
\tab\tab return null;\par
\tab\}\par
\tab\par
\tab //\'b0\'d1\'c9\'fa\'b3\'c9\'b4\'fa\'c0\'ed\'c0\'e0\'b7\'e2\'d7\'b0\'b5\'bd\'b4\'fa\'c0\'ed\'c0\'e0\'d6\'d0============\par
\tab //@param obj \'b1\'bb\'b4\'fa\'c0\'ed\'b5\'c4\'c0\'e0\par
\tab public static Object factory(Object obj) \{\par
\tab\tab Class<?> c = obj.getClass();\par
\tab\tab return Proxy.newProxyInstance(c.getClassLoader,\par
\tab\tab\tab  c.getInterfaces(), new ProxyClazz(obj)); //\'b5\'da\'c8\'fd\'b8\'f6\'b2\'ce\'ca\'fd\'d0\'b4\'ce\'aathis\'bf\'c9\'b7\'f1\'a3\'ac\'d5\'e2\'d1\'f9\'b7\'bd\'b7\'a8\'be\'cd\'b2\'bb\'d3\'c3\'b4\'ab\'b2\'ce\'c1\'cb\'a3\'ac\'bc\'fb\'cf\'c2\'c3\'e6\'b5\'f7\'d3\'c3\'ca\'b1\'b8\'c4\'b6\'af\'b4\'a6\par
\tab\}\par
\tab //====================================\par
\par
\}\par
//\'bf\'cd\'bb\'a7\'c0\'e0\par
public class Client \{\par
\tab public static void main(String[] args) \{\par
\tab\tab RealClazz realClazz = new RealClazz();\par
\tab\tab InvocationHandler proxy = new ProxyClazz(realClazz);\par
\tab\tab //\'d2\'bb\'b4\'ce\'d0\'d4\'c9\'fa\'b3\'c9\'b4\'fa\'c0\'ed\'c0\'e0\par
\tab\tab Clazz clazz = (Clazz)Proxy.newProxyInstance(RealClass.getClass().getClassLoader,\par
\tab\tab\tab  RealClazz.getClass().getInterfaces(), proxy);\par
\tab\tab clazz.process();\par
\par
\tab\tab //\'b7\'e2\'d7\'b0\'ba\'f3\'b5\'c4\'b5\'f7\'d3\'c3====\par
\tab\tab Clazz clazz = (Clazz)(new ProxyClazz().factory(new RealClazz()));\par
\tab\tab //\'c8\'e7\'b9\'fb\'d0\'b4\'b3\'c9 new ProxyClazz(new RealClazz()).factory();\par
\tab\tab clazz.process();\par
\tab\tab //===============\par
\tab\}\par
\}\par
\par
==================================\par
= \'d7\'a2\'bd\'e2\'d1\'a7\'cf\'b0\par
==================================\par
\'d2\'bb\'a3\'ba\'cf\'b5\'cd\'b3\'cc\'e1\'b9\'a9\'b5\'c43\'b8\'f6\'c4\'ac\'c8\'cf\'b5\'c4\'b1\'ea\'d7\'bc\'d7\'a2\'bd\'e2\par
\tab 1. @Override ------------ \'b1\'ed\'ca\'be\'d6\'d8\'d0\'b4\par
\tab 2. @Deprecated ---------- \'b1\'ed\'ca\'be\'b2\'bb\'bd\'a8\'d2\'e9\'ca\'b9\'d3\'c3\par
\tab 3. @SuppressWarnings() -- \'d2\'d6\'d6\'c6\'be\'af\'b8\'e6\par
\tab\tab\'c6\'e4\'d6\'b5\'d3\'d07\'b8\'f6\par
\tab\tab -- deprecation\par
\tab\tab -- unchecked\par
\tab\tab -- fallthrough\par
\tab\tab -- path\par
\tab\tab -- serial\par
\tab\tab -- finally\par
\tab\tab -- all\par
\'b6\'fe\'a3\'baMeta-annotation(\'d3\'c3\'c0\'b4\'d0\'de\'ca\'ce\'d7\'a2\'bd\'e2\'bf\'c9\'d2\'d4\'d3\'c3\'b5\'bd\'c4\'c4\'c0\'ef)\par
\tab 1.@Retention() -- \'d7\'a2\'bd\'e2\'bd\'ab\'b1\'bb\'b1\'a3\'c1\'f4\'b5\'bd\'c4\'c4\'c0\'ef -- \'c6\'e4\'d6\'b5\'ca\'c7\'d2\'bb\'b8\'f6RetentionPolicy\'c3\'b6\'be\'d9\'d6\'b5\par
\tab\tab public enum RetentionPolicy \{\par
\tab\tab\tab SOURCE,  //\'d7\'a2\'bd\'e2\'d6\'bb\'c1\'f4\'d4\'da\'d4\'b4\'b4\'fa\'c2\'eb\'ce\'c4\'bc\'fe\'d6\'d0\par
\tab\tab\tab CLASS,   //\'d7\'a2\'bd\'e2\'c1\'f4\'d4\'daclass\'ce\'c4\'bc\'fe\'d6\'d0\'a3\'ac\'b5\'ab\'d0\'e9\'c4\'e2\'bb\'fa\'ce\'de\'b7\'a8\'b6\'c1\'c8\'a1\par
\tab\tab\tab RUNTIME  //\'d7\'a2\'bd\'e2\'c1\'f4\'d4\'daclass\'ce\'c4\'bc\'fe\'d6\'d0\'a3\'ac\'d0\'e9\'c4\'e2\'bb\'fa\'bf\'c9\'d2\'d4\'b6\'c1\'c8\'a1\'a3\'ac\'d5\'e2\'ca\'b1\'b7\'b4\'c9\'e4\'bb\'fa\'d6\'c6\'be\'cd\'bf\'c9\'d2\'d4\'b5\'c3\'b5\'bd\'d5\'e2\'b8\'f6\'d7\'a2\'bd\'e2\par
\tab\tab\}\par
\tab 2.@Target() -- \'b8\'c3\'d7\'a2\'bd\'e2\'bf\'c9\'d2\'d4\'d4\'da\'c4\'c4\'d0\'a9\'c4\'bf\'b1\'ea\'c9\'cf\'ca\'b9\'d3\'c3 -- \'c6\'e4\'d6\'b5\'ca\'c7\'d2\'bb\'b8\'f6ElementType\'c3\'b6\'be\'d9\'d6\'b5\par
\tab\tab public enum ElementType \{\par
\tab\tab\tab ANNOTATION_TYPE,    //\par
\tab\tab\tab CONSTRUCTOR,        //\'d6\'bb\'c4\'dc\'d3\'c3\'b5\'bd\'b9\'b9\'d4\'ec\'b7\'bd\'b7\'a8\'c9\'cf\par
\tab\tab\tab FIELD,              //\'d6\'bb\'c4\'dc\'d3\'c3\'b5\'bd\'ca\'f4\'d0\'d4\'c9\'cf\par
\tab\tab\tab LOCAL_VARIABLE,     //\'d6\'bb\'c4\'dc\'d3\'c3\'b5\'bd\'be\'d6\'b2\'bf\'b1\'e4\'c1\'bf\'c9\'cf\par
\tab\tab\tab METHOD,             //\'d6\'bb\'c4\'dc\'d3\'c3\'b5\'bd\'b7\'bd\'b7\'a8\'c9\'cf\par
\tab\tab\tab PACKAGE,            //\'d6\'bb\'c4\'dc\'d3\'c3\'b5\'bd\'b0\'fc\'c9\'cf\par
\tab\tab\tab TYPE                //\'d6\'bb\'c4\'dc\'d3\'c3\'b5\'bd \'c0\'e0\'a1\'a2\'bd\'d3\'bf\'da\'a1\'a2\'c3\'b6\'be\'d9\'c9\'cf\par
\tab\tab\}\par
\tab 3.@Documented -- \'d4\'da\'d6\'c6\'d7\'f7javaDoc\'ca\'b1\'ca\'c7\'b7\'f1\'bd\'ab\'d7\'a2\'bd\'e2\'d0\'c5\'cf\'a2\'d0\'b4\'c8\'ebjavaDoc\par
\tab 4.@Inherited\par
\'c8\'fd\'a3\'ba\'d7\'d4\'bc\'ba\'b6\'a8\'d2\'e5\'d7\'a2\'bd\'e2\par
\tab\'b5\'b1\'d7\'a2\'bd\'e2\'d6\'d0\'b5\'c4\'ca\'f4\'d0\'d4\'c3\'fb\'d7\'d6\'ce\'aavalue\'ca\'b1\'a3\'ac\'d4\'da\'b6\'d4\'c6\'e4\'bd\'f8\'d0\'d0\'b8\'b3\'d6\'b5\'ca\'b1\'bf\'c9\'d2\'d4\'b2\'bb\'d6\'b8\'b6\'a8\'ca\'f4\'d0\'d4\'c3\'fb\par
\tab\'b3\'fd\'c1\'cbvalue\'d2\'d4\'cd\'e2\'b5\'c4\'ca\'f4\'d0\'d4\'c3\'fb\'d4\'da\'ce\'aa\'c6\'e4\'b8\'b3\'d6\'b5\'ca\'b1\'b6\'bc\'d2\'aa\'d6\'b8\'b6\'a8\'ca\'f4\'d0\'d4\'c3\'fb\par
\'d7\'a2\'d2\'e2:\par
\tab\'b5\'b1\'ce\'d2\'c3\'c7\'b6\'a8\'d2\'e5\'b5\'c4\'d7\'a2\'bd\'e2\'c0\'e0\'c6\'e4\'ca\'b5\'d2\'fe\'ca\'bd\'b5\'c4\'ca\'b5\'cf\'d6\'c1\'cbjava.lang.annotation.Annotation\'bd\'d3\'bf\'da\par
\tab\'c8\'e7\'b9\'fb\'ce\'d2\'c3\'c7\'d7\'d4\'bc\'ba\'b6\'a8\'d2\'e5\'d2\'bb\'b8\'f6\'bd\'d3\'bf\'da\'c8\'c3\'cb\'fc\'cf\'d4\'ca\'bd\'b5\'c4\'ca\'b5\'cf\'d6Annotation\'bd\'d3\'bf\'da\'a3\'ac\'d4\'f2\'d5\'e2\'b8\'f6\'bd\'d3\'bf\'da\'c8\'d4\'c8\'bb\'d6\'bb\'ca\'c7\'d2\'bb\'b8\'f6\'bd\'d3\'bf\'da\'b6\'f8\'b2\'bb\'ca\'c7\'d7\'a2\'bd\'e2\par
\par
\tab\par
\par
//\'b6\'a8\'d2\'e5\'d7\'a2\'bd\'e2\'c0\'e0\par
\par
@Retention(RetentionPolicy.SOURCE)\par
@Target(ElementType.METHOD)\par
public @interface AnnotationDemo \{\par
\tab String value() default "hello";  //\'b6\'a8\'d2\'e5\'b3\'c9\'d4\'b1\'b2\'a2\'b8\'f8\'b6\'a8\'c4\'ac\'c8\'cf\'d6\'b5\par
\tab EnumTest value2();\par
\tab int[] value3();\par
\}\par
enum EnumTest \{\par
\tab Hello, World, Welcome\par
\}\par
\par
\f0\par
}
 